package com.tpp.base.client;

import com.tpp.base.mapper.ItemMapper;
import com.tpp.comm.client.ItemClient;
import com.tpp.comm.pojo.TpItem;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ItemClientImpl implements ItemClient {

    @Resource
    private ItemMapper itemMapper;

    @Value("${server.port}")
    private String port;

    @Override
    public TpItem findById(Integer itemId){
        TpItem tpItem = itemMapper.selectById(itemId);
        tpItem.setItemName(tpItem.getItemName()+"-"+port);
        return tpItem;
    }
}
